import request from '@/api/request/index'
import type { SkuQueRenDTO, ConfirmSkuInfo, DingDanXiaSkuQueRenDTO, CaiGouDanChaoShiQueRenDTO } from './_interfaces.ts'

/** 订单附件下载 */
export function supplierPoApprovalOrderAttachmentDownload(data: { orderId?: string }): Promise<any> {
  return request.get('/api/supplierPoApproval/orderAttachmentDownload', data)
}

/** 订单附件下载批量 */
export function supplierPoApprovalOrderAttachmentDownloadBatch(data: { orderIds?: string[] }): Promise<any> {
  return request.get('/api/supplierPoApproval/orderAttachmentDownloadBatch', data)
}

/** 订单确认 */
export function supplierPoApprovalOrderConfirm(data: SkuQueRenDTO): Promise<number> {
  return request.post('/api/supplierPoApproval/orderConfirm', data)
}

/** 采购单导出 */
export function supplierPoApprovalOrderExportBatch(data: { orderIds?: string[] }): Promise<any> {
  return request.get('/api/supplierPoApproval/orderExportBatch', data)
}

/** 现结供应商催款 */
export function supplierPoApprovalPressForMoney(data: { poIds?: string[] }): Promise<any> {
  return request.get('/api/supplierPoApproval/pressForMoney', data)
}

/** 订单确认前列表查询 */
export function supplierPoApprovalQuerySkuListBeforeConfirm(data: { orderId?: string }): Promise<ConfirmSkuInfo> {
  return request.get('/api/supplierPoApproval/querySkuListBeforeConfirm', data)
}

/** 微信消息发送测试 */
export function supplierPoApprovalSendMessageTest(data: { orderId?: string }): Promise<any> {
  return request.post('/api/supplierPoApproval/sendMessageTest', data)
}

/** sku确认 */
export function supplierPoApprovalSkuConfirm(data: DingDanXiaSkuQueRenDTO): Promise<any> {
  return request.get('/api/supplierPoApproval/skuConfirm', data)
}

/** 模板上传 */
export function supplierPoApprovalTemplateUpload(data: {
  // 图册信息
  file?: File[]
}): Promise<any> {
  return request.post('/api/supplierPoApproval/templateUpload')
}

/** 采购单超时确认 */
export function supplierPoApprovalTimeoutConfirm(data: CaiGouDanChaoShiQueRenDTO): Promise<any> {
  return request.post('/api/supplierPoApproval/timeoutConfirm', data)
}
